library(RTextTools);

data <-read.csv('trainingsample.csv',sep = ""),header=TRUE)

dtMatrix <- create_matrix(data["article"])

container <- create_container(dtMatrix, data$flyktingar, trainSize=1:577, virgin=FALSE)

model <- train_model(container, "SVM", kernel="linear", cost=1)

predictionData <-read.csv('prediction.csv',sep = ""),header=TRUE)

predictData <- read.delim('vocabulary.txt')
predMatrix <- create_matrix(predictData, originalMatrix = dtMatrix)

predSize = length(predictionData);
predictionContainer <- create_container(predMatrix, labels=rep(0,predSize), testSize=1:predSize, virgin=FALSE)

results <- classify_model(predictionContainer, model)
results